import datetime
import json
from typing import Dict, List
import os, shutil


class FileUtils:

    @staticmethod
    def del_all_files(file_path):
        """
        删除目录下的所有文件
        """
        for root, dirs, files in os.walk(file_path, topdown=False):
            print("root", root)
            print("dirs", dirs)
            print("files", files)
            # firstly : 删除文件
            for name in files:
                os.remove(os.path.join(root, name))
            # secondly: 删除空文件夹
            for name in dirs:
                os.rmdir(os.path.join(root, name))
        os.rmdir(file_path)



if __name__ == '__main__':
    j = '{"id": "007", "name": "007", "age": 28, "sex": "male", "phone": "13000000000", "email": "123@qq.com"}'

    wdw = {}
    list = [{"ww":1},{"sw":2}]
    wdw['w'] = list
    dates = [datetime.date(2000,3,2),datetime.date(2020,3,5)]
    IOUtils.save_dict(wdw,"ss.json")

    d = IOUtils.load_dict("ss.json")
    print(f"{d}")

